﻿namespace Sapphire.Linq.Mappers
{
    public abstract class ObjectMapper<TFrom> : IObjectMapper
    {
        public TTo Map<TTo>(object value, object[] parameters)
        {
            return Map<TTo>((TFrom)value, parameters);
        }

        protected abstract TTo Map<TTo>(TFrom value, object[] parameters);

        public bool IsMatch<TTo>(object value, object[] parameters)
        {
            return value is TFrom;
        }
    }
}